package com.iot.ic.dao;

import com.iot.ic.model.StadiumResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface StadiumResultMapper {
    int deleteByPrimaryKey(Integer stadiumResultId);

    int insert(StadiumResult record);

    int insertSelective(StadiumResult record);

    StadiumResult selectByPrimaryKey(Integer stadiumResultId);

    int updateByPrimaryKeySelective(StadiumResult record);

    int updateByPrimaryKey(StadiumResult record);
    
    List<StadiumResult> listStadiumResultByTeam(int stadiumId);

    List<Map<String,Object>>selectTeamCount(@Param("start")Date start, @Param("end")Date end);

    List<Map<String,Object>>selectStadiumResultByTeam(List<Integer>teamIds);

    List<StadiumResult>selectStadiumResultDetailByTeam(List<Integer>teamIds);

    List<StadiumResult> selectStadiumResultList(@Param("start")Date start, @Param("end")Date end);

    StadiumResult getStadiumResultByTeamAndStadium(StadiumResult record);

    List<StadiumResult>selectStadiumResultWithScenes(int teamId);
    
    List<Map<String,Object>> listStadiumResultByStadiumType(@Param("stadiumId")int stadiumId);

    int updateStadiumResultScore(@Param("stadiumResultId")int stadiumResultId,@Param("scoreChange")int scoreChange,
    		@Param("scenesScoreChange")int sceneScoreChange, @Param("roadScoreChange")int roadScoreChange);
    
    StadiumResult getStadiumResultLeastByTeam(int teamId);
    
    StadiumResult selectStadiumResultWithScenesbyStadium(@Param("teamId") int teamId, @Param("stadiumId")int stadiumId);
    
    Map<String,Object> selectTeamTotalScore(@Param("teamId")Integer teamId);
}